<!DOCTYPE html>
<html>
  <head>
	<div th:include="base-libs :: base-libs" />
    <title>医生详细</title>
	
    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta name="content-type" content="text/html; charset=UTF-8">
    
    <style>
    	.title{
			height:40px;
			line-height:40px;
			font-size:16px;
			background:#F7F9FB;
			margin-left:0;
			font-weight:bold;
		}
		.marginTop{
			margin-top:8px;
		}
    </style>
    
    <script>
    	$(function(){
    		layer.load(1, {
    			  shade: [0.1,'#fff'], //0.1透明度的白色背景
    			  time: -1
    			})
    		$(this).registerManagerPage({
    			cacheTables:["TB_ZY_PRACTICE_FW"],
    			callback: initData
    	    });
    	})
    	
    	function initData(){
    		
    		var tdYsid = StoreCache.removeCache("tdYsid");
    		if(tdYsid){
    			$.QuickRemote.AjaxJson(contextRoot + "tdgl/queryYljgryxxByUserid", queryDataBack, {USERID:tdYsid});
    		}
    	}
    	
    	/** 查询医生信息回调  */
    	function queryDataBack(result){
//     		alert(JSON.stringify(result))
    		if(!result.info){
    			//职务
    			result.ZWDM = result.ZW;
    			//执业范围
    			var FWDM = result.PRACTICE_FWDM;
    			if(!StringUtils.isEmpty(FWDM)){
    				var FWDMArr = FWDM.split(',');
    				var FWArr = [];
    				$.each(FWDMArr, function(i,item){
    					var FW = getZyXmmcByXmdm('TB_ZY_PRACTICE_FW',item);
    					if(!StringUtils.isEmpty(FW))
    					FWArr.push(FW)
    				})
    				result.PRACTICE_FWDM = FWArr.join();
    			}
    			//是否多点执业
    			var ddzyObj = {'0':'否','1':'是'};
    			result.PRACTICE_DDZY = ddzyObj[result.PRACTICE_DDZY] || '-';
    			
    			for(var key in result){
    				var cacheTable = $("#"+key).attr("cacheTable");
    				if(StringUtils.isEmpty(cacheTable)){
	    				$("#"+key).html(result[key]);
    				}else{
    					var value = getZyXmmcByXmdm(cacheTable,result[key]);
    					$("#"+key).html(value);
    				}
    			}
    			
    			//是否多点执业
    			if(result.PRACTICE_DDZY=='是'){
    				$.QuickRemote.AjaxJson(contextRoot + "tdgl/queryYljgryDdzy", function(result){
    					if(!result.info){
    						var $ddzyBox = $("#ddzyBox");
    						var data = result.data;
    						var number_CN = ['二','三','四','五','六','七','八','九','十'];
    						$.each(data, function(i,item){
    							var ddzyModel = $($("#ddzyModel").html());
    							var number = number_CN[i] || i+2;
    							ddzyModel.find('[name=YLJGMC_title]').html('第'+ number +'执业机构名称');
    							ddzyModel.find('[name=YLJGMC]').html(item.YLJGMC);
    							ddzyModel.find('[name=ZYJGLB_title]').html('第'+ number +'执业机构类别');
    							ddzyModel.find('[name=ZYJGLB]').html(item.WSJGLBMC);
    							$ddzyBox.append(ddzyModel)
    						})
    					}else{
    						$.QuickAlert.alertFail({content: result.info});
    					}
    				}, {USERID: result.USERID});
    			}
    		}else{
    			$.QuickAlert.alertFail({content: result.info});
    		}
    	}
    	
    	/** 根据值域代码返回名称  */
    	function getZyXmmcByXmdm(zyTable,XMDM){
    		var result = XMDM;
    		
    		var zyData = StoreCache.getCache(zyTable);
    		if(!$.isEmptyObject(zyData)){
    			$.each(zyData.data, function(i, item){
    				if(item.XMDM==XMDM){
    					result = item.XMMC;
    					return false;
    				}
    			})
    		}
    		return result;
    	}
    </script>
  </head>
  
  <body>
  <div class="easyui-layout" fit="true" style="overflow-x:hidden;">
  		<div region="north" border="false" style="overflow:hidden;background:#438eb9;color:#fff;">
  			<h3 style="text-align:center;line-height: 41px; margin: 0px; font-size: 18px;font-weight: bold;">医生详细</h3>
  		</div>
  		<div region="center" border="false" style="background:#fff"><!-- style="background:#f9f9f9" -->
  			<div class="title" style="position:relative">&nbsp;&nbsp;基本信息</div>
  			<table class="form-table">
				<tr>
					<td class="td-text">姓名：</td>
					<td class="td-content" id="XM"></td>
					<td class="td-text">性别：</td>
					<td class="td-content" id="XB" cacheTable="TB_ZY_XB"></td>
					<td class="td-text">籍贯：</td>
					<td class="td-content" id="JG"></td>
				</tr>
				<tr>
					<td class="td-text">出生日期：</td>
					<td class="td-content" id="CSRQ"></td>
					<td class="td-text">手机号码：</td>
					<td class="td-content" id="SJHM"></td>
					<td class="td-text">联系电话：</td>
					<td class="td-content" id="ZZDH"></td><!-- 住宅电话 -->
				</tr>
				<tr>
					<td class="td-text">证件号码：</td>
					<td class="td-content" colspan="5" id="SFZH"></td>
				</tr>
			</table>
			
			<div class="title marginTop">&nbsp;&nbsp;教育背景</div>
  			<table class="form-table">
				<tr>
					<td class="td-text">学历：</td>
					<td class="td-content" id="ZGXLDM" cacheTable="TB_ZY_XL"></td>
					<td class="td-text">专业：</td>
					<td class="td-content" id="SXZYMC"></td>
					<td class="td-text">学位：</td>
					<td class="td-content" id="ZGXWDM" cacheTable="TB_ZY_XW"></td>
				</tr>
			</table>
			
			<div class="title marginTop">&nbsp;&nbsp;职业背景</div>
  			<table class="form-table">
				<tr>
					<td class="td-text">岗位名称：</td>
					<td class="td-content" id="GWMCDM" cacheTable="TB_ZY_GWMC"></td>
					<td class="td-text">参加工作时间：</td>
					<td class="td-content" id="CJGZRQ"></td>
				</tr>
				<tr>
					<td class="td-text">岗位类别：</td>
					<td class="td-content" id="GWLBDM" cacheTable="TB_ZY_GWLB"></td>
					<td class="td-text">岗位编码：</td>
					<td class="td-content" id="GWBM" cacheTable="TB_ZY_GWBM"></td>
				</tr>
				<tr>
					<td class="td-text">人员身份：</td>
					<td class="td-content" id="RYSFDM" cacheTable="TB_ZY_RYSF"></td>
					<td class="td-text">身份编制：</td>
					<td class="td-content" id="SFBZ" cacheTable="TB_ZY_SFBZ"></td>
				</tr>
				<tr>
					<td class="td-text">执业级别：</td>
					<td class="td-content" id="PRACTICE_JBDM" cacheTable="TB_ZY_PRACTICE_JB"></td>
					<td class="td-text">职称：</td>
					<td class="td-content" id="ZC" cacheTable="TB_ZY_ZC"></td>
				</tr>
				<tr>
					<td class="td-text">注册号码：</td>
					<td class="td-content" id="PRACTICE_BM"></td>
					<td class="td-text">执业类别：</td>
					<td class="td-content" id="PRACTICE_LBDM" cacheTable="TB_ZY_PRACTICE_LB"></td>
				</tr>
				<tr>
					<td class="td-text">执业范围：</td>
					<td class="td-content" colspan="3" id="PRACTICE_FWDM"></td>
				</tr>
			</table>
			
			<div class="title marginTop">&nbsp;&nbsp;所属医院</div>
  			<table class="form-table" id="ddzyBox">
				<tr>
					<td class="td-text">医院名称：</td>
					<td class="td-content" id="YLJGMC"></td>
					<td class="td-text">科室名称：</td>
					<td class="td-content" id="KSMC"></td>
				</tr>
				<tr>
					<td class="td-text">工号：</td>
					<td class="td-content" id="YSGH"></td>
					<td class="td-text">职务代码：</td>
					<td class="td-content" id="ZWDM"></td>
				</tr>
				<tr>
					<td class="td-text">职务名称：</td>
					<td class="td-content" id="ZW" cacheTable="TB_ZY_ZW"></td>
					<td class="td-text">是否多点执业：</td>
					<td class="td-content" id="PRACTICE_DDZY"></td>
				</tr>
			</table>
	  		<div style="height:20px;"><!-- 让用户知道页面已经到达底部 --></div>
  		</div>
  	</div>
  </body>
  <script type="text/html" id="ddzyModel">
  		<tr>
			<td class="td-text" name="YLJGMC_title"></td>
			<td class="td-content" name="YLJGMC"></td>
			<td class="td-text" name="ZYJGLB_title"></td>
			<td class="td-content" name="ZYJGLB"></td>
		</tr>
  </script>
</html>
